package demo1;

public class computer {


    public void open1(){
        System.out.println("打开电脑");
    }

    public void close1(){
        System.out.println("关闭电脑");
    }

    public void useIUSB(IUSB iusb){

        iusb.open();

        if(iusb instanceof Mouse){
            Mouse mouse=(Mouse)iusb;
            mouse.click();
        }
        if(iusb instanceof key_borad){
            key_borad key=(key_borad)iusb;
            key.borad();
        }

        iusb.close();
    }


}
